import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
    path: '/',
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '/home',
    component: () => import('@/views/home'),
    redirect: '/welcome',
    children: [{
        path: "/welcome",
        component: () => import('@/views/welcome')
      },
      {
        path: "/users",
        component: () => import('@/views/users')
      },
      {
        path: "/roles",
        component: () => import('@/views/roles')
      },
      {
        path: "/rights",
        component: () => import('@/views/rights')
      },
      {
        path: "/goods",
        component: () => import('@/views/goods'),
      },
      {
        path: "/categories",
        component: () => import('@/views/categories')
      },
      {
        path: "/params",
        component: () => import('@/views/params')
      },
      {
        path: "/orders",
        component: () => import('@/views/orders')
      },
      {
        path: "/reports",
        component: () => import('@/views/reports')
      },
      {
        path: "/add",
        component: () => import('@/views/add')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})



export default router
